Ext.define('MyApp.store.DepartmentTreeStore',{
    extend: 'Ext.data.TreeStore',
    constructor: function(cfg) {
        var me = this;
        cfg = cfg || {};
        me.callParent([Ext.apply({
            proxy: {
                type: 'ajax',
                actionMethods: 'POST',
                url: './rs/department/queryDepartmentList',
                reader: {
                    type: 'json',
                    root: 'nodes',
                    totalProperty : 'totalCount'
                }
            },
            nodeParam: 'id',
            root: {
                id: '1',
                text: "杭州恒牛信息技术有限公司",
                expanded: true
            },
            sorters: [{
                property: 'text',
                direction: 'ASC'
            }]
        }, cfg)]);
    }
});